<template>
<div>
  <div id="editorElem" style="text-align:left"></div>
</div>
</template>

<script>
  import E from 'wangeditor'
  export default {
    name: 'editor',
    data () {
      return {
        editorContent: ''
      }
    },
    methods: {
      getContent: function () {
        console.log(this.editorContent)
      }
    },
    mounted() {
      var editor = new E('#editorElem')
      editor.customConfig.uploadImgShowBase64 = true   // 使用 base64 保存图片
      editor.customConfig.onchange = (html) => {
        this.editorContent = html
      }
      editor.create()
    }
  }
</script>

<style scoped>
</style>
